<!--
 * @Description: 
 * @Author: wgy
 * @CreateTime: 2022-12-15 22:39:38
 * @UpdateTime: 2022-12-15 23:00:49
 * @FilePath: \reacte\react_basic\02_虚拟dom的两种创建方式\jsx创建虚拟dom.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 定义一个容器 -->
    <div id="box"></div>

    <!-- 引入react核心库 -->
    <script type="text/javascript" src="../js/react.development.js"></script>
    <!-- 引入react-domm库 用于操作dom -->
    <script type="text/javascript" src="../js/react-dom.development.js"></script>
    <!-- 引入babel,用于将jsx转换为js -->
    <script type="text/javascript" src="../js/babel.min.js"></script>

    <script type="text/babel">
        // 创建虚拟dom
        const VDOM = (
            <h1>hello react <span>123</span></h1>
        )
        // 渲染元素
        ReactDOM.render(VDOM, document.getElementById("box"))
    </script>

</body>

</html>